<template>
  <el-row class="sc-mt-16" type="flex" align="center">
    <el-row type="flex" align="center" class="dv-button" @click.native="logout">
      <ScIcon class="sc-fs-24" iconClass="logout"></ScIcon>
      <div class="name sc-mr-6">注销</div>
    </el-row>
  </el-row>
</template>
<script>
import { logout } from '@/backgroundUtils/initPlugin';
export default {
  name: "PopupFooter",
  methods: {
    logout() {
      console.log("登出")
      //TODO
      logout();
      this.$EventBus.$emit("changeCompant", "LoginPlugin");
      // chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
      //     chrome.tabs.sendMessage(tabs[0].id, {action: "sc-logout"}, function (response) {
      //     });
      //     setTimeout(function () {
      //         window.close();
      //     }, 100);
      // });
    }
  }
};
</script>
<style lang="scss" scoped>
.dv-button {
  box-sizing: border-box;
  border-radius: 4px;
  color: #a1a5c4;
  height: 32px;
  width: 120px;
  cursor: pointer;
  padding: 4px;
  &:hover {
    border: 1px solid #17baa1;
    transition: border 0.2s;
    padding: 3px;
    color: #17baa1;
  }
  .name {
    font-size: 14px;
  }
}
</style>